package org.cuatrovientos.erp.business;

import java.util.List;

import org.cuatrovientos.erp.model.Currency;
import org.cuatrovientos.erp.dao.CurrencyDAO;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Holds all the business logic for Currency related management
 * @author Enrico Martinez
 * @greetz Any
 *
 */
public class CurrencyBO implements BOGenericInterface {
	
	// Get log4j logger
	private static final Logger logger = Logger.getLogger(CurrencyBO.class);
	
	@Autowired
    private CurrencyDAO currencyDAO;

	@Override
	public Currency selectById(int id) {
		logger.info("selectById: " + id);
		return currencyDAO.selectById(id);
	}

	@Override
	public List<Currency> selectAll() {
		logger.info("selectAll: ");
		return currencyDAO.selectAll();
	}



	@Override
	public void deleteById(int id) {
		logger.info("delete: " + id);
		 currencyDAO.delete(id);
	}

	@Override
	public void insert(Object currency) {
		logger.info("insert: " + currency);
		currencyDAO.insert(currency);
	}

	@Override
	public void update(Object currency) {
		logger.info("update: " + currency);
		currencyDAO.update(currency);
	}


}
